//条件语句 if(){}else{}
var age =23;

if (age>18) {

	console.log("成人");
}else{


	console.log("未成年");
}

/*
if(condition1)else if() {} else{}

if (condition1) {
	pass
} else if(condition2){
	pass
}else {
	pass
}
*/
var score=80;

if(score>=90){

console.log("A");

}else if(score>=80){

console.log("B");

}else if(score>=70){

console.log("C");

}else if(score>=60){

	console.log("D");
}else{
	console.log("");
}
/*
switch ... case 

switch(expression){
	
	case value1:

		console.log("当表达式等于value1执行");
		break;
	case value2:
		console.log("当表达式等于value2执行");
		break;
	default:
		console.log("当表达式不匹配任意值执行");
}


*/

var week=7;

switch(week){

	case 1:
		console.log("周一");
		break;
	case 2:
		console.log("周二");
		break;

	case 3:
		console.log("周三");
		break;
	case 4:
		console.log("周四");
		break;
	case 5:
		console.log("周五");
		break;
	case 6:
		console.log("周六");
		break;
	default:
		console.log("周日");	
		break;	

}

/*
循环语句


while(condition){
	//循环体
}


for(1声明循环开始;2条件;4循环计数)
{
	
	3循环体
}
*/

let i =1;

while(i<=5){
	console.log(i);
	i++;
}

for (let i = 1;i<=5; i++) {
if(i%2==1){
console.log(i);
}
}

for (let i = 0; i < 5; i++) {
	if(i==3){
		// continue;
		break;
	}
	console.log(i);
}